package cn.crc.model.imp;

import java.util.List;

import org.hibernate.Query;

public interface IPublicDAO {
	/**
	 * @author doublel
	 * 
	 * retrive data from database through HSQL
	 * 
	 * @param String hsql
	 * @return List list 
	 * */
	List getDataByHSQL(String hsql);
	/**
	 * @author doublel
	 * 
	 * retrive data from database through SQL
	 * 
	 * @param String sql
	 * @return List list 
	 * */	
	
	
	List getDataBySQL(String sql);
	
	
	
	/**
	 * @author doublel
	 *  save update Object to DataBase 
	 *  @param Object obj
	 *  @return null
	 * */
	void saveOrUpdate(Object obj);
	
	/**
	 * @author doublel
	 * delete record from DataBase
	 * @param Object obj
	 * @return null
	 * */
	void delete(Object obj);
	
	/**
	 * @author doublel
	 * get system from Database  from (sysdate,'YYYY/MM/DD')
	 * @param null
	 * @return String  format YYYY/MM/DD
	 * */
	String getSystemDate();
	
	
	/**
	 * @author doublel
	 * get system from Database  format (sysdate,'YYYY/MM/DD HH24:MI:SS')
	 * @param null
	 * @return String  format YYYY/MM/DD HH24:MI:SS
	 * */
	String getSystemDateTime();
	
	/**
	 * @author doublel
	 * @param String hsql
	 * @return Query query
	 * 利用占位符来形成HSQL
	 * */
	
	Query createQuery(String hsql);
	
}
